Skip to content

feat(renderer): add dynamic terminal resize support - #12

Merged
venice-dev[bot] merged 18 commits into
soli-testbench:mainfrom
Chris-Moller:agent/73047d31-b9aa-4262-9d19-24eac57184c8
Mar 20, 2026
Merged

feat(renderer): add dynamic terminal resize support#12
venice-dev[bot] merged 18 commits into
soli-testbench:mainfrom
Chris-Moller:agent/73047d31-b9aa-4262-9d19-24eac57184c8

Conversation

@Chris-Moller

Copy link
Copy Markdown
Contributor

Summary

Adds dynamic terminal resize support to the terminal emulator, enabling real-time response to window/container resize events.

Changes

  • Cell measurement (_measureCellSize): Measures character cell dimensions (width/height) by creating a hidden probe span with the terminal's font settings, enabling accurate cols/rows calculation from pixel dimensions.
  • ResizeObserver (_setupResizeObserver): Attaches a ResizeObserver to the terminal container to detect size changes automatically.
  • Debouncing: Resize events are debounced at 100ms to prevent excessive recomputation during continuous resizing.
  • Dimension update (_handleResize): Computes new cols/rows from container pixel size, calls terminal.resize(cols, rows) to update internal state, re-renders the terminal, and fires an onResize callback for backend PTY notification (SIGWINCH equivalent).
  • Cleanup (dispose): Disconnects the ResizeObserver and clears timers.
  • Tests: Added resize-specific tests (grow, shrink, 1x1, scroll region reset, post-resize functionality) — all 119 tests pass.

Acceptance Criteria Met

  • ResizeObserver detects container size changes
  • Character cell dimensions measured from rendered font
  • Resize events debounced (100ms)
  • terminal.resize(cols, rows) called with new dimensions
  • Backend/PTY notified via onResize callback
  • Terminal re-rendered correctly after resize
  • Existing functionality preserved (scrollback, cursor, escape sequences)

Venice Agent and others added 12 commits March 19, 2026 19:15
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add ResizeObserver-based container resize detection with debounced
recalculation of terminal dimensions from measured character cell size.
Includes onResize callback for PTY/SIGWINCH notification and dispose()
for cleanup. Add resize edge-case tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove CLAUDE.md, PLAN.md, and tasks.json from the branch as they are
not needed for the resize feature delivery and were flagged in security
review as non-runtime artifacts that could influence automation workflows.
@Chris-Moller
Chris-Moller force-pushed the agent/73047d31-b9aa-4262-9d19-24eac57184c8 branch 3 times, most recently from 43c067a to 4f9d93c Compare March 19, 2026 23:31
Venice Agent and others added 2 commits March 19, 2026 23:31
- Add focused test for resize callback invocation semantics
- Document callback-only PTY notification design in renderer.js
- Out-of-scope metadata files (PLAN.md, tasks.json) already removed

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Chris-Moller
Chris-Moller force-pushed the agent/73047d31-b9aa-4262-9d19-24eac57184c8 branch from 4f9d93c to 98a19b4 Compare March 19, 2026 23:31
Venice Agent and others added 2 commits March 19, 2026 23:55
- Wire renderer.onResize in demo integration layer for PTY notification
- Add integration tests proving resize emits backend notification with cols/rows
- Document onResize callback contract and failure behavior in renderer.js

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Chris-Moller
Chris-Moller force-pushed the agent/73047d31-b9aa-4262-9d19-24eac57184c8 branch 2 times, most recently from dcfea6d to e5dc4ca Compare March 19, 2026 23:57
Venice Agent and others added 2 commits March 19, 2026 23:57
- Wire onResize in demo with structured PTY message and CustomEvent dispatch
- Add integration test exercising full _handleResize flow with SIGWINCH-equivalent notification
- Verify no duplicate notification for unchanged dimensions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Chris-Moller
Chris-Moller force-pushed the agent/73047d31-b9aa-4262-9d19-24eac57184c8 branch 2 times, most recently from dfa35b2 to 788f864 Compare March 19, 2026 23:58
@venice-dev
venice-dev Bot merged commit aba73f7 into soli-testbench:main Mar 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants